package com.intelligentcar.springboot.controller;

import com.intelligentcar.springboot.bean.Linelist;
import com.intelligentcar.springboot.bean.Parameter;
import com.intelligentcar.springboot.bean.Scheduling;
import com.intelligentcar.springboot.bean.Vehicle;
import com.intelligentcar.springboot.service.ParameterServer;
import com.intelligentcar.springboot.service.SchedulingServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@Controller
public class SchedulingController {
    @Autowired
    private SchedulingServer schedulingServerImpl;

    @RequestMapping("/selectLine1")
    @ResponseBody
    public List<Linelist> selectLine1(){
        return schedulingServerImpl.selectLine1();
    }

    @RequestMapping("/selectVehicle")
    @ResponseBody
    public List<Vehicle> selectVehicle(@RequestBody Scheduling scheduling){
        return schedulingServerImpl.selectVehicle(scheduling);
    }

    @RequestMapping("/selectDrivername")
    @ResponseBody
    public List<Scheduling> selectDrivername(@RequestBody Scheduling scheduling){
        return schedulingServerImpl.selectDrivername(scheduling);
    }

    @RequestMapping("/selectScheduling")
    @ResponseBody
    public List<Scheduling> selectScheduling(){
        return schedulingServerImpl.selectScheduling();
    }

    @RequestMapping("/addScheduling")
    @ResponseBody
    public int addScheduling(@RequestBody Scheduling scheduling){
        return schedulingServerImpl.addScheduling(scheduling);
    }

    @RequestMapping("/selectTime")
    @ResponseBody
    public List<Scheduling> selectTime(@RequestBody Scheduling scheduling){
        return schedulingServerImpl.selectTime(scheduling);
    }

}
